package com.yfbao.horizon.inspection.prometheus;

import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
public class MetricsResponseDto {
    private boolean success;
    private String errorMsg;
    private String promQL;
    private int abnormalCount;
    private List<MetricsDto> details;
    private LocalDateTime queryTime;

    public MetricsResponseDto() {
        this.queryTime = LocalDateTime.now();
    }

    public static MetricsResponseDto errorResult(String errorMsg) {
        MetricsResponseDto result = new MetricsResponseDto();
        result.setSuccess(false);
        result.setErrorMsg(errorMsg);
        return result;
    }
}
